﻿<UserControl x:Class="TouchCafe.Views.OrderView"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
      Background="Black">
    <UserControl.Resources>
        <Style TargetType="{x:Type ListBox}">
            <Setter
                Property="ScrollViewer.HorizontalScrollBarVisibility"
                Value="Disabled"
                />
        </Style>
    </UserControl.Resources>
        <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>

        <ListBox Name="listBox" Grid.Row="0" ItemsSource="{Binding Items}" Background="Transparent" BorderBrush="Transparent" SelectionMode="Multiple"
                 SelectionChanged="ListBox_SelectionChanged" MouseDoubleClick="ListBox_MouseDoubleClick">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="24">
                        <Image Source="{Binding Value.Image}" Width="275"/>
                    </Grid>
                </DataTemplate>

            </ListBox.ItemTemplate>
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <WrapPanel Orientation="Horizontal"
                                           IsItemsHost="True"/>
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
        </ListBox>
        <Button Grid.Row="1" Content="Checkout" FontSize="24" Height="72" Command="{Binding CheckoutCommand}"/>
    </Grid>
</UserControl>
